package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.CompanyAuthVo;
import cn.ywsj.ywsjmidtier.entity.VO.CompanyVo;
import cn.ywsj.ywsjmidtier.service.WechatCompanyFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "企业信息")
@RestController
@RequestMapping("/wechat/member/companymgr/")
public class WechatCompanyController {
    @Autowired
    private WechatCompanyFeign companyFeign;

    /**
     * 企业资料_保存
     * @param companyAuthVo
     * @param companyVo
     * @param request
     * @return
     */
    @ApiOperation("企业资料_保存")
    @PostMapping("/ajaxupdatecompany")
    public String updateCompany( CompanyVo companyVo){
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(companyVo);
        return companyFeign.updateCompany(jsonObject);
    }

    /**
     * 企业资料_企业详情
     * @param request
     * @param response
     * @return
     */
    @ApiOperation("企业资料_企业详情")
    @PostMapping("/companydetail")
    public String companyDetail(HttpServletRequest request, HttpServletResponse response) {
        return companyFeign.companyDetail(request,response);
    }
}
